package com.wxm.log.core;

import lombok.Data;

import java.util.Map;

/**
 * <p>
 * 全局返回类
 * </p>
 *
 * @author: wxm
 * @Date: 2021/10/5
 */
@Data
public class R {
    private String msg;
    private Integer code;
    private Object data;

    public static R ok(Object data){
        R r = new R();
        r.setCode(200);
        r.setData(data);
        return r;
    }

    public static R error(String msg){
        R r = new R();
        r.setCode(500);
        r.setMsg(msg);
        r.setData(null);
        return r;
    }
}
